Skip to content

Applies to

net10.0-android36.0

public PlatformBitmapLoader(Func<string, int> drawableResolver)

View source

Summary: Initializes a new instance of the PlatformBitmapLoader class.

Parameters

NameTypeDescription
drawableResolverFuncA function that maps drawable names to resource IDs. Use a switch expression for AOT-friendly compile-time mapping.

Examples

var loader = new PlatformBitmapLoader<Resource.Drawable>(name => name switch
 {
 "icon" => Resource.Drawable.icon,
 "logo" => Resource.Drawable.logo,
 _ => 0 // Return 0 for unknown resources
 });